﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

using XCode;
using BingZi.HY.Core;

namespace BingZi.HY.Core
{
	/// <summary>
	/// 应用字段值
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("应用字段值")]
	[BindTable("sys_FieldValue", Description = "应用字段值", ConnName = "System")]
	public partial class sys_FieldValue
	{
		#region 属性
		private Int32 _ValueID;
		/// <summary>
		/// 索引ID号
		/// </summary>
		[Description("索引ID号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "ValueID", "索引ID号", "", "int", 10, 0, false)]
		public Int32 ValueID
		{
			get { return _ValueID; }
			set { if (OnPropertyChanging("ValueID", value)) { _ValueID = value;   } }
		}

		private String _V_F_Key;
		/// <summary>
		/// 与sys_Field表中F_Key字段关联
		/// </summary>
		[Description("与sys_Field表中F_Key字段关联")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(2, "V_F_Key", "与sys_Field表中F_Key字段关联", "", "varchar(50)", 0, 0, false)]
		public String V_F_Key
		{
			get { return _V_F_Key; }
			set { if (OnPropertyChanging("V_F_Key", value)) { _V_F_Key = value;   } }
		}

		private String _V_Text;
		/// <summary>
		/// 中文说明
		/// </summary>
		[Description("中文说明")]
		[DataObjectField(false, false, true, 100)]
		[BindColumn(3, "V_Text", "中文说明", "", "nvarchar(100)", 0, 0, true)]
		public String V_Text
		{
			get { return _V_Text; }
			set { if (OnPropertyChanging("V_Text", value)) { _V_Text = value;   } }
		}

		private String _V_Code;
		/// <summary>
		/// 编码
		/// </summary>
		[Description("编码")]
		[DataObjectField(false, false, true, 100)]
		[BindColumn(4, "V_Code", "编码", "", "varchar(100)", 0, 0, false)]
		public String V_Code
		{
			get { return _V_Code; }
			set { if (OnPropertyChanging("V_Code", value)) { _V_Code = value;   } }
		}

		private Int32 _V_ShowOrder;
		/// <summary>
		/// 同级显示顺序
		/// </summary>
		[Description("同级显示顺序")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(5, "V_ShowOrder", "同级显示顺序", "0", "int", 10, 0, false)]
		public Int32 V_ShowOrder
		{
			get { return _V_ShowOrder; }
			set { if (OnPropertyChanging("V_ShowOrder", value)) { _V_ShowOrder = value;   } }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "ValueID" : return _ValueID;
					case "V_F_Key" : return _V_F_Key;
					case "V_Text" : return _V_Text;
					case "V_Code" : return _V_Code;
					case "V_ShowOrder" : return _V_ShowOrder;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "ValueID" : _ValueID = Convert.ToInt32(value); break;
					case "V_F_Key" : _V_F_Key = Convert.ToString(value); break;
					case "V_Text" : _V_Text = Convert.ToString(value); break;
					case "V_Code" : _V_Code = Convert.ToString(value); break;
					case "V_ShowOrder" : _V_ShowOrder = Convert.ToInt32(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得应用字段值字段名的快捷方式
		/// </summary>
        [CLSCompliant(false)]
		public class _
		{
			///<summary>
			/// 索引ID号
			///</summary>
			public const String ValueID = "ValueID";

			///<summary>
			/// 与sys_Field表中F_Key字段关联
			///</summary>
			public const String V_F_Key = "V_F_Key";

			///<summary>
			/// 中文说明
			///</summary>
			public const String V_Text = "V_Text";

			///<summary>
			/// 编码
			///</summary>
			public const String V_Code = "V_Code";

			///<summary>
			/// 同级显示顺序
			///</summary>
			public const String V_ShowOrder = "V_ShowOrder";
		}
		#endregion
	}
}